package com.guan.ioc.controller;

import com.guan.ioc.model.DataSourceConfig2;
import com.guan.ioc.model.Dbtypes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/yml")
public class YmlController {

    @Value("${key}")
    private String key;

    @Value("${spring.datasource.url}")
    private String url;

    @Autowired
    private DataSourceConfig2 config;

    @Autowired
    private Dbtypes dbtypes;

    @RequestMapping("/readValue")
    public String readValue() {
        System.out.println("key:" + key);
        System.out.println("url:" + url);
        System.out.println(config);
        System.out.println(dbtypes);
        System.out.println();
        return "key:" + key;
    }
}
